package com.yjd.comm.user.service;

import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.user.dto.UserSession;
import com.yjd.comm.user.model.UserModel;

/**
 * <b>description</b>：用户业务接口<br>
 * <b>time</b>：2017-06-27 08:58:59 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
public interface IUserService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public UserModel insert(UserModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(UserModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param user_id
	 * @return
	 * @throws Exception
	 */
	public int delete(long user_id) throws Exception;

	/**
	 * 获取用户信息
	 * @param idUser
	 * @return UserSession
	 * @throws Exception
	 */
	public UserSession getUserSession(Long idUser) throws Exception;

	/**
	 * 手机号是否被占用
	 * @param mobile
	 * @return boolean
	 */
	public boolean mobileIsExits(String mobile) throws Exception;

	/**
	 * 手机端注册
	 * @param pwd 密码
	 * @param mphoneNo 手机号
	 * @param deviceNo 终端号
	 * @param deviceName 终端名称
	 * @param ip ip地址
	 * @return mobile_type
	 * @throws Exception
	 */
	public UserModel regModel(String pwd, String mphoneNo, String deviceNo, String deviceName, String regid, String ip) throws Exception;


	/**
	 * 修改交易密码
	 * @param idUser 用户号
	 * @param password 密码
	 * @return session
	 * @throws Exception
	 */
	public boolean modifyPayPassword(Long idUser, String password) throws Exception;

	/**
	 * 用户登陆
	 *
	 * @param mobile_number
	 * @param password
	 * @return
	 * @throws Exception
	 */
	public UserModel login(String mobile_number, String password) throws Exception;
}
